package com.example.yuejian.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.yuejian.Adapter.MyAttetionAdapter;
import com.example.yuejian.Bean.Attention;
import com.example.yuejian.R;
import com.example.yuejian.listener.ClubListener;
import com.example.yuejian.model.AttentionModel;

import java.util.List;


public class MyAttention extends AppCompatActivity implements ClubListener<Attention> {

    private RecyclerView recyclerView;
    MyTitle myTitle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_attention);
        recyclerView = (RecyclerView)findViewById(R.id.recyclerView_post);
        recyclerView.setLayoutManager(new LinearLayoutManager(MyAttention.this));
        myTitle = (MyTitle)findViewById(R.id.tt);
        myTitle.setTitle("我的关注");
        AttentionModel attentionModel = new AttentionModel();
        attentionModel.attentionData(this,2,1);
    }

    @Override
    public void onResponse(Attention attention) {
        List<Attention.AttentiondataBean> attentiondataBeen = attention.getAttentiondata();
        MyAttetionAdapter adapter = new MyAttetionAdapter(MyAttention.this,attentiondataBeen);
        recyclerView.setAdapter(adapter);
    }

    @Override
    public void onFail(String msg) {

    }
}
